// "http://www.laoli.com?a=1&b=2&c=3",把查询字符串转为对象{a:1,b:2,c:3}

const url = "http://www.laoli.com?a=1&b=2&c=3"

const obj = url.split('?')[1].split("&").reduce((pre, cur) => {
    const key = cur.split('=')[0]
    const val = cur.split('=')[1]
    pre[key] = val
    return pre
}, {})
console.log(obj);


